package com.liao.badminton.dto;

import com.liao.badminton.code.BaseField;
import com.liao.badminton.code.validation.Delete;
import com.liao.badminton.code.validation.FindDetail;
import com.liao.badminton.code.validation.Insert;
import com.liao.badminton.code.validation.Update;
import com.liao.badminton.entity.StipulationLevel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.List;

/**
 * @author liaocheng
 * @date 2024-11-08
 * description:等级划分规则表
 */
@Data
public class StipulationLevelAddsDto extends BaseField {
    @ApiModelProperty(value = "id")
    private Long id;
    @NotNull(message = "群id不能为空")
    @ApiModelProperty(value = "群id")
    private Long groupId;
    @NotNull(message = "等级名称不能为空")
    private String levelName;
    @NotNull(message = "条件下限不能为空")
    @ApiModelProperty(value = "最低下限包含：比如前5名>=5")
    private BigDecimal scopeLow;
    @NotNull(message = "条件上限不能为空")
    @ApiModelProperty(value = "最大上限不包含：比如<0")
    private BigDecimal scopeHigh;
    @NotNull(message = "条件类型不能为空")
    @ApiModelProperty(value = "1.胜率 2.获得奖励 3.名次")
    private Integer stipulationType;
    @ApiModelProperty(value = "作用：比如前5名，要让5分，后5名，要+5分")
    private BigDecimal effect;

    @ApiModelProperty(value = "stipulation_type=3时，名次排序类型：1.胜率 2.获得奖励 3.净胜分")
    private Integer rankType;
    @ApiModelProperty(value = "是否有效：0:无效，1:有效")
    private Integer useStatus;


    public StipulationLevel invertEntity() {
        StipulationLevel dto = new StipulationLevel();
        BaseField.invert(this, dto);
        dto.setId(this.getId());
        dto.setGroupId(this.getGroupId());
        dto.setLevelName(this.getLevelName());
        dto.setScopeLow(this.getScopeLow());
        dto.setScopeHigh(this.getScopeHigh());
        dto.setStipulationType(this.getStipulationType());
        dto.setEffect(this.getEffect());
        dto.setRankType(this.getRankType());
        dto.setUseStatus(this.getUseStatus());
        return dto;
    }
}
